package com.ssy.lingxi.enhance.api.model.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 修改加工入库单 - DTO
 * @author fhj
 * @date 2020/12/02
 * @version 2.0.0
 */
@Data
public class UpdateStorageDTO {

    @NotNull(message = "生产通知单ID不能为空")
    @ApiModelProperty(value = "生产通知单ID")
    private Long produceNoticeOrderId;

    @NotNull(message = "入库单ID不能为空")
    @ApiModelProperty(value = "入库单ID")
    private Long storageId;

    @Valid
    @NotEmpty(message = "单据明细不能为空")
    @ApiModelProperty(value = "单据明细")
    private List<StorageDetailsDTO> storageDetailsDTOList;

    @Data
    public static class StorageDetailsDTO {

        @NotNull(message = "生产通知单明细ID不能为空")
        @ApiModelProperty(value = "生产通知单明细ID")
        private Long produceNoticeOrderDetailId;

        @NotBlank(message = "商品名称不能为空")
        @ApiModelProperty(value = "商品名称")
        private String productName;

        @NotNull(message = "入库数量不能为空")
        @ApiModelProperty(value = "入库数量")
        private Double storageCount;
    }
}
